Skip to main content

HolographAccountFactory

Services • API


Holograph SDK Reference / Services / HolographAccountFactory

Class: HolographAccountFactory

HolographAccountFactory

Remarks

Creates HolographAccounts. A HolographAccount is a wrapper for an Externally Owned Account (EOA). An account is a fundamental unit of state within the Ethereum blockchain. It has a unique address, a balance of ether (ETH), and can send transactions.

Constructors

new HolographAccountFactory(undefined)

new HolographAccountFactory(): HolographAccountFactory

Returns

HolographAccountFactory

Methods

createAccountUsingEip1193Provider()

static createAccountUsingEip1193Provider(eip1193Provider): Promise<JsonRpcAccount>

Create account using a provider from a browser extension wallet (e.g. Metamask). https://eips.ethereum.org/EIPS/eip-1193

Parameters

eip1193Provider

A JavaScript Ethereum Provider API that follows the EIP-1193.

eip1193Provider.request: EIP1193RequestFn<[object, object, object, object, object]>

eip1193Provider.on

eip1193Provider.removeListener

Returns

Promise<JsonRpcAccount>

Example

await createAccountUsingEip1193Provider(window.ethereum)

Source

packages/sdk/src/services/wallet.service.ts:61


createAccountUsingMnemonic()

static createAccountUsingMnemonic(mnemonic, options): HDAccount

Parameters

mnemonic: string

options: HDOptions= {}

Returns

HDAccount

Source

packages/sdk/src/services/wallet.service.ts:47


createAccountUsingPrivateKey()

static createAccountUsingPrivateKey(privateKey): PrivateKeyAccount

Parameters

privateKey: 0x${string}

Returns

PrivateKeyAccount

Source

packages/sdk/src/services/wallet.service.ts:43